cmake_minimum_required(VERSION 3.20)

if(UNIX)
set(PROJECT_LABEL "todo-app")
else()
set(PROJECT_LABEL "TodoApp")
endif()

project(${PROJECT_LABEL} LANGUAGES CXX)

find_package(spdlog CONFIG REQUIRED)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

file(GLOB_RECURSE sources "src/*.cpp")
file(GLOB_RECURSE headers "src/*.h")

source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${sources} ${headers})

set(project_sources
${sources} ${headers}
)

add_executable(${PROJECT_NAME} ${project_sources})

target_precompile_headers(${PROJECT_NAME} PRIVATE "src/pch.h")

target_link_libraries(${PROJECT_NAME} PRIVATE TodoApp::Storage PUBLIC spdlog::spdlog)
